function countDown(time) {
    var nowTime = new Date();
    var overTime = new Date(time);
    var times = (overTime - nowTime) / 1000;
    //天数
    var d = parseInt(times / 60 / 60 / 24);
    d = d < 10 ? '0' + d : d;
    //小时
    var h = parseInt(times / 60 / 60 % 24);
    h = h < 10 ? '0' + h : h;
    //分钟
    var m = parseInt(times / 60 % 60);
    m = m < 10 ? '0' + m : m;
    //秒
    var s = parseInt(times % 60);
    s = s < 10 ? '0' + s : s;
    return d + '天' + h + '时' + m + '分' + s + '秒';
}
console.log(countDown('2024-3-30 18:36:20'));